

<template>
<div>
<!--  <select @change="changeValue($event)">-->
  <select v-model="value">
    <option>请选择</option>
    <option>1</option>
    <option>2</option>
    <option>3</option>
    <option>4</option>

  </select>
  <p>{{value}}</p>
</div>
</template>

<script>
import {reactive,toRefs} from "vue";

export default {
  setup(){
    const data=reactive({
      value:"2"
    })
    return{
      // 需要将方法暴露到模板中
      ...toRefs(data)
    }
  },
  methods:
  {
    changeValue(evt){
      this.value=evt.target.value;
    }
  }
}
</script>